function exit(){
	  layui.use( 'laydate', function(){
		  var layer = layui.layer;
		  layer.closeAll();
	  });
	 
}
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,laydate = layui.laydate
  ,layer = layui.layer
  ,layedit = layui.layedit;
  
  
 
   
  
//监听提交
  form.on('submit(formDemo)', function(data){
	  var index=parent.layer.getFrameIndex(window.name);
	  parent.layer.close(index);
  });
   
  var url="../../listenRawstockType/findRawstockTypeRtId.action";
  var data=null;
  $.post(url,data,function(mes){
	  $.each(mes.data,function(i,item){
			  $("#rtId").append("<option value="+item.rtId+">"+item.rtName+"</option>")
			  load();
	  })
  },"json")
 
 
  form.on('submit(formEdit)', function(){
	  var url="../../listenRawstock/addOrUpdate.action";
	  var data={"rawstockName":$("#rawstockName").val(),"rtId":$("#rtId").val(),"rawstockId":$("#rawstockId").val(),"rawstockPrice":$("#rawstockPrice").val(),"rawstockExplain":$("#rawstockExplain").val()};
	  $.post(url,data,function(mes){
		  if(mes>0){
			  window.parent.location.reload()
			  var index=parent.layer.getFrameIndex(window.name);
			  parent.layer.close(index);
		  }
	  },"json")
 
  });
  
});
layui.use('upload', function(){
	  var $ = layui.jquery
	  ,upload = layui.upload;
	  
	  
	
});
function load(){
	var form = layui.form;
	form.render();
}